package com.project.livetv.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import java.util.List;

/**
 * Created by li on 2016/5/10.
 */
public abstract class MyBaseAdapter<T> extends BaseAdapter {
    private List<T> list;
    private Context mContext;
    public MyBaseAdapter(Context context, List<T> list){
        mContext=context;
        this.list=list;
    }
    @Override
    public int getCount() {

        return list==null?0:list.size();
//        return 5;
    }

    @Override
    public Object getItem(int position) {
        return list.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public abstract View getView(int position, View convertView, ViewGroup parent) ;

}
